 program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  m, i, j, k, n, l:integer;
  fin, fout: TextFile;
  mass: array of integer;

begin
  assignFile(fin, 'input.txt');
  assignFile(fout, 'output.txt');
  reset(fin);
  rewrite(fout);
  readln(fin, n);
  setlength(mass, n);
  for i:=0 to n-1 do
   read(fin, mass[i]);
  for i:=0 to n-2 do
  begin
    for j:=0 to n-i-1 do
    begin
      if mass[j]<mass[j+1] then
      begin
        l:=mass[j+1];
        mass[j+1]:=mass[j];
        mass[j]:=l;
      end;
    end;
    for k:= 0 to n-1 do
      write( mass[k], ' ');
  end;
  for i:= 0 to n-1 do
    write(fout, mass[i], ' ');
  closeFile(fin);
  closeFile(fout);
  readln;
end.

